This repository was archived by the owner on May 15, 2026. It is now read-only.
fix(lm-studio): only include parallel_tool_calls when explicitly enabled - #11072
Draft
ghost wants to merge 1 commit into
Draft
fix(lm-studio): only include parallel_tool_calls when explicitly enabled#11072ghost wants to merge 1 commit into
ghost wants to merge 1 commit into
Conversation
This fixes an issue where GLM4.5 and other models via LM Studio get stuck in a loop repeatedly reading the same file. The problem was introduced in commit ed35b09 which changed parallel_tool_calls default from false to true. By only including the parallel_tool_calls parameter when explicitly set to true, we maintain compatibility with models that do not support this parameter (e.g., GLM4.5). This follows the same pattern used in commit 2d4dba0 for LiteLLM/Bedrock compatibility. Fixes #11071
Author
Reviewed and no issues found. The fix correctly addresses the compatibility issue by only including Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR attempts to address Issue #11071 where GLM4.5 (and potentially other models) via LM Studio get stuck in a loop repeatedly reading the same file.
Root Cause
The issue was introduced in commit ed35b09 (Jan 29, 2026) which changed the
parallel_tool_callsparameter default fromfalsetotruefor the LM Studio handler. Not all models support this parameter, and when sent to models like GLM4.5 that do not support it, it can cause unexpected behavior such as the model getting stuck in a loop.Solution
This fix changes the LM Studio handler to only include the
parallel_tool_callsparameter when explicitly set totrue(i.e., whenmetadata?.parallelToolCalls === true). This approach:Changes
src/api/providers/lm-studio.tsto conditionally includeparallel_tool_callssrc/api/providers/__tests__/lmstudio-native-tools.spec.tsto verify the new behaviorTesting
parallel_tool_callsis NOT included by defaultparallel_tool_calls: trueIS included when explicitly setFixes #11071
Feedback and guidance are welcome.
Important
LmStudioHandlernow conditionally includesparallel_tool_callsonly when explicitly enabled, fixing compatibility issues with certain models.LmStudioHandlerinlm-studio.tsnow includesparallel_tool_callsonly whenmetadata?.parallelToolCalls === true.parallel_tool_calls.lmstudio-native-tools.spec.tsto verifyparallel_tool_callsis not included by default.parallel_tool_calls: trueis included when explicitly set.This description was created by
for 332b66c. You can customize this summary. It will automatically update as commits are pushed.